//
//  NewWebView.m
//  eyeinfo
//
//  Created by kingsoft on 11-1-12.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "NewWebView.h"
#import "GlobalCls.h"
#import "eyeinfoAppDelegate.h"

@implementation NewWebView

@synthesize m_webView;
@synthesize m_rssItem;

- (void)viewDidLoad {
	self.title = m_rssItem.title;

	NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
	
	NSString *filePath = [resourcePath stringByAppendingPathComponent:@"NewsViewTemplate.html"];
	NSString *htmlstring=[[NSString alloc] initWithContentsOfFile:filePath  encoding:NSUTF8StringEncoding error:nil];
//	[m_webView loadHTMLString:htmlstring baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];

	NSString * strUrl = [NSString stringWithFormat:@"http://kensouly.appspot.com/getnewdata?n_id=%@", m_rssItem.n_id ];
	NSString * strWebHtml = [NSString stringWithFormat:htmlstring,
							 resourcePath,
							 resourcePath,
							 resourcePath,
							 resourcePath,
							 resourcePath,
							 resourcePath,
							 resourcePath,
							 m_rssItem.title,
							 [GlobalCls getStringByCompressUrl:strUrl],
							 resourcePath
							 ];
	m_webView.backgroundColor = [UIColor clearColor];
	m_webView.opaque = NO;
	[[self m_webView] loadHTMLString:strWebHtml baseURL:nil];
	m_webView.autoresizesSubviews = TRUE;
}


@end
